package binary;

public class ComplementDemo {
        public static void main(String[] args) {
            int max = Integer.MAX_VALUE;
            int min = Integer.MIN_VALUE;
            System.out.println(Integer.toBinaryString(max));//01111....
            System.out.println(Integer.toBinaryString(min));//100000...
            System.out.println(Integer.toBinaryString(-1));//1111...
            System.out.println("------------");
            int n = -45;
            System.out.println(Integer.toBinaryString(n));//2进制显示
            System.out.println(n);//10进制显示
            System.out.println(Integer.toHexString(n));//16进制显示
        }
    }
